<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>订单列表</title>
    <link rel="stylesheet" href="__CSS__/pintuer.css">
    <link rel="stylesheet" href="__CSS__/admin.css">
    <script src="__JS__/jquery.js"></script>
    <script src="__JS__/pintuer.js"></script>
</head>
<body>
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 内容列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">
        <li> <a class="button border-main icon-plus-square-o" href="good_add.html"> 添加内容</a> </li>
        <form action="" method="get" id="F">
        <li>搜索：</li>
        <!--<li>-->
            <!--&lt;!&ndash;首页 &ndash;&gt;-->
        	<!--&lt;!&ndash;<select name="is_shows" style="padding:5px 15px; border:1px solid #ddd;" >&ndash;&gt;-->
        		<!--&lt;!&ndash;<option value="">选择</option>&ndash;&gt;-->
            <!--&lt;!&ndash;<option value="1">是</option>&ndash;&gt;-->
            <!--&lt;!&ndash;<option value="0">否</option>&ndash;&gt;-->
          <!--&lt;!&ndash;</select>&ndash;&gt;-->
         	 <!--推荐-->
          <!--<select name="recommended" style="padding:5px 15px; border:1px solid #ddd;" >-->
          	<!--<option value="" <{$recommended==''?'selected':''}>>选择</option>-->
            <!--<option value="1" <{$recommended=='1'?'selected':''}>>是</option>-->
            <!--<option value="0" <{$recommended=='0'?'selected':''}>>否</option>-->
          <!--</select>-->
          	<!--下架-->
          <!--<select name="if_show" style="padding:5px 15px; border:1px solid #ddd;" >-->
          	<!--<option value="" <{$if_show==''?'selected':''}>>选择</option>-->
            <!--<option value="1" <{$if_show=='1'?'selected':''}>>是</option>-->
            <!--<option value="0" <{$if_show=='0'?'selected':''}>>否</option>-->

          <!--</select>-->
       	 <!--</li>-->
            <li>
                订单时间: <input type="datetime-local" name="mintime" value="<{$mintime}>">
                <input type="datetime-local" name="maxtime" value="<{$maxtime}>">

            </li>
            <li>
                <input type="number" style="width:80px;" placeholder="价格最小" name="minjia" value="<{$minjia}>">
                <input type="number" style="width:80px;" placeholder="价格最大" name="maxjia" value="<{$maxjia}>">

            </li>
            <li>　
                <label> <input type="radio" name="recom" value="200" {eq name="200" value="$recom|default='200'"}checked{/eq} /> 全部</label>　
                {foreach name='recommended' item='value' key='k'}
                <label> <input type="radio" name="recom" value="<{$k}>" {eq name="k" value="$recom|default='200'"}checked{/eq} /> <{$value}></label>　
                {/foreach}
            </li>
            <li>
                {foreach name="goods_if_show" item="value"}
                <label> <input type="checkbox" name="if_show[]" value="<{$key}>" {in name="key" value="$if_show|default=[]"}checked{/in} /> <{$value}></label>　
                {/foreach}
          <li>
          	<select name="bid" style="padding:5px 15px; border:1px solid #ddd;">
	            <option value="" <{$bid==''?'selected':''}>>请选择分类</option>
                {volist name='alist' id='vo'}
	            	<option value="<{$vo['brand_id']}>" <{$bid==$vo['brand_id']?'selected':''}>><{$vo['brand_name']}></option>
              	{/volist}
          	</select>
          </li>
            <li>
                分类 :
                <select name="cate_id" id="">
                    <option value="">请选择分类</option>
                    {volist name='cate' id='vo'}
                    {if $vo['parent_id'] == 0}
                    <option value="<{$vo['cate_id']}>" <{$cate_id==$vo['cate_id']?'selected':""}> style="font-weight:bold;">
                    <{$vo['cate_name']}>
                    </option>
                    {volist name='cate' id='v'}
                    {if $v['parent_id'] == $vo['cate_id']}
                    <option value="<{$v['cate_id']}>" <{$cate_id==$v['cate_id']?'selected':""}>>|--<{$v['cate_name']}></option>
                    {volist name='cate' id='vv'}
                    {if $vv['parent_id']==$v['cate_id']}
                    <option value="<{$vv['cate_id']}>" <{$cate_id==$vv['cate_id']?'selected':""}>>|-----<{$vv['cate_name']}></option>
                    {/if}
                    {/volist}
                    {/if}
                    {/volist}
                    {/if}
                    {/volist}
                </select>
            </li>
        <li>
          <input type="text" placeholder="请输入搜索关键字" name="keywords" class="input" style="width:200px; line-height:17px;display:inline-block" value="<{$keywords}>"/>
          <a href="javascript:F.submit();" class="button border-main icon-search" > 搜索</a></li>
      </ul>
      </form>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="10%" style="text-align:left; padding-left:20px;">ID</th>
        <th width="15%">商品名称</th>
        <th width="10%">图片</th>
          <th width="10%">品牌</th>
        <th width="5%">价格</th>
        <th width="10%">分类名称</th>
        <th width="10%"><a href="<{:url('good',$get)}>">上架时间</a> <{$flag|default=''}></th>
        <th width="10%">推荐</th>
        <th width="5%">下架</th>
        <th width="15%">操作</th>
      </tr>
        {volist name='list' id='vo'}
      <tr>
          <td style="text-align:left; padding-left:20px;"><input type="checkbox" name="id[]" value="" /><{$vo['goods_id']}></td>
          <td><{$vo['goods_name']|raw}></td>
          <td width="10%">
              {empty name="vo['default_image']"}
              <img height="50px" src="<{$default_image}>" alt="<{$vo['goods_name']|substr=0,6}>" />
              {else /}
              <img height="50px" src="/storage/<{$vo['default_image']}>" alt="<{$vo['goods_name']|substr=0,6}>" />
              {/empty}
          </td>
          <td><{$vo['brand_name']}></td>
          <td><{$vo['price']}></td>
          <td> <{$vo['cate_name']}></td>
          <td><{$vo['add_time']}></td>
          <td><font color="<{$vo['recommended']=='推荐'?'#00CC99':'red'}>"><{$vo['recommended']}></font></td>
          <td><font color="<{$vo['if_show']=='上架'?'#00CC99':'red'}>"><{$vo['if_show']}></font></td>
          <td><div class="button-group"> <a class="button border-main" href="good_add.html"><span class="icon-edit"></span> 修改</a> <a class="button border-red" href="javascript:void(0)" onclick="return del(1,1,1)"><span class="icon-trash-o"></span> 删除</a> </div></td>
        </tr>
         {/volist}

        <td style="text-align:left; padding:19px 0;padding-left:20px;"><input type="checkbox" id="checkall"/>
          全选 </td>
        <td colspan="9" style="text-align:left;padding-left:20px;"><a href="javascript:void(0)" class="button border-red icon-trash-o" style="padding:5px 15px;" onclick="DelSelect()"> 删除</a> <a href="javascript:void(0)" style="padding:5px 15px; margin:0 10px;" class="button border-blue icon-edit" onclick="sorts()"> 排序</a> 操作：
          <select name="ishome" style="padding:5px 15px; border:1px solid #ddd;" onchange="changeishome(this)">
            <option value="">首页</option>
            <option value="1">是</option>
            <option value="0">否</option>
          </select>
          <select name="isvouch" style="padding:5px 15px; border:1px solid #ddd;" onchange="changeisvouch(this)">
            <option value="">推荐</option>
            <option value="1">是</option>
            <option value="0">否</option>
          </select>
          <select name="istop" style="padding:5px 15px; border:1px solid #ddd;" onchange="changeistop(this)">
            <option value="">下架</option>
            <option value="1">是</option>
            <option value="0">否</option>
          </select>
        </td>
      </tr>
      <tr>
        <td colspan="9"><div class="pagelist"> <{$list|raw}> </div></td>
      </tr>
    </table>
  </div>
<script type="text/javascript">

//搜索
function changesearch(){	
		
}

//单个删除
function del(id,mid,iscid){
	if(confirm("您确定要删除吗?")){
		
	}
}

//全选
$("#checkall").click(function(){ 
  $("input[name='id[]']").each(function(){
	  if (this.checked) {
		  this.checked = false;
	  }
	  else {
		  this.checked = true;
	  }
  });
})

//批量删除
function DelSelect(){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		var t=confirm("您确认要删除选中的内容吗？");
		if (t==false) return false;		
		$("#listform").submit();		
	}
	else{
		alert("请选择您要删除的内容!");
		return false;
	}
}

//批量排序
function sorts(){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){	
		
		$("#listform").submit();		
	}
	else{
		alert("请选择要操作的内容!");
		return false;
	}
}


//批量首页显示
function changeishome(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		
		$("#listform").submit();	
	}
	else{
		alert("请选择要操作的内容!");		
	
		return false;
	}
}

//批量推荐
function changeisvouch(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		
		
		$("#listform").submit();	
	}
	else{
		alert("请选择要操作的内容!");	
		
		return false;
	}
}

//批量置顶
function changeistop(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){		
		
		$("#listform").submit();	
	}
	else{
		alert("请选择要操作的内容!");		
	
		return false;
	}
}


//批量移动
function changecate(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){		
		
		$("#listform").submit();		
	}
	else{
		alert("请选择要操作的内容!");
		
		return false;
	}
}

//批量复制
function changecopy(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){	
		var i = 0;
	    $("input[name='id[]']").each(function(){
	  		if (this.checked==true) {
				i++;
			}		
	    });
		if(i>1){ 
	    	alert("只能选择一条信息!");
			$(o).find("option:first").prop("selected","selected");
		}else{
		
			$("#listform").submit();		
		}	
	}
	else{
		alert("请选择要复制的内容!");
		$(o).find("option:first").prop("selected","selected");
		return false;
	}
}

</script>
</body>
</html>